package com.souche.employment.controller;

import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.souche.employment.domain.EmployeeDO;
import com.souche.employment.domain.JobDO;
import com.souche.employment.mapper.JobMapper;
import com.souche.employment.response.CustomException;
import com.souche.employment.response.DataResult;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

/**
 * BaseController.java created at 2017年8月8日 下午1:11:20
 * 
 * @author Ray [email:rayinhangzhou@hotmail.com] Revision History Date Programmer Notes
 *         ----------------------------------------------------------
 **/
@RestController
@Api(value = "/employ", description = "简历相关接口")
public class EmployController {
	@Autowired
	private JobMapper		jobMapper;
	
	

	@RequestMapping(value = "/addEmployee", method = RequestMethod.POST)
	@ApiOperation(value = "添加简历")
	public DataResult addEmployee(@ApiParam(value = "姓名", required = true) @RequestParam String name,
			@ApiParam(value = "性别：先生|女士", required = true) @RequestParam String gender,
			@ApiParam(value = "联系方式", required = true) @RequestParam String phone,
			@ApiParam(value = "邮箱", required = true) @RequestParam String mail,
			@ApiParam(value = "简历获取方式：投递|搜索|内推|外推", required = true) @RequestParam String getType,
			@ApiParam(value = "简历来源，标签", required = true) @RequestParam String referee,
			@ApiParam(value = "备注标签") @RequestParam(required = false) String tips,
			@ApiParam(value = "工作年限", required = true) @RequestParam Integer workAge,
			@ApiParam(value = "职位id", required = true) @RequestParam String jobId,
			@ApiParam(value = "邀请进度：未接听|待答复|已约面|拒绝邀约", required = true) @RequestParam String inviteStatus,
			@ApiParam(value = "面试进度：未参加面试|初试通过|复试通过|录用|淘汰|储备|已入职|已离职", required = true) @RequestParam String interviewStatus,
			@ApiParam(value = "约面时间") @RequestParam(required = false) String interviewTime,
			@ApiParam(value = "面试方式，标签") @RequestParam(required = false) String interviewType,
			@ApiParam(value = "一面面试官") @RequestParam(required = false) String interviewer1,
			@ApiParam(value = "二面面试官") @RequestParam(required = false) String interviewer2) {
		JobDO job = jobMapper.getJob(jobId);
		if (job==null) {
			throw CustomException.fail("该职位已不存在！", null);
		}
		EmployeeDO employeeDO = new EmployeeDO();
		employeeDO.setId(UUID.randomUUID().toString());
		return DataResult.success(null);
	}
}
